import request from '@/utils/request'

// 订单-删除订单
export const delOrder = (id) => request({
  url: `/patient/order/${id}`,
  method: 'DELETE'
})

// 订单-取消订单
export const cancelOrder = (id) => request({
  url: `/patient/order/cancel/${id}`,
  method: 'PUT'
})

// 订单-支付接口
export const orderPay = (data) => request({
  url: '/patient/consult/pay',
  method: 'POST',
  data
})

// 药品订单-根据处方ID查询处方单
export const referPrescription = (id) => request({
  url: `/patient/consult/prescription/${id}`,
  method: 'GET'
})

// 订单-查询收货地址列表
export const getOrderAddress = () => request({
  url: '/patient/order/address',
  method: 'GET'
})

// 药品订单-支付药款页面-根据处方信息计算药款
export const getOrderPre = (params) => request({
  url: '/patient/medicine/order/pre',
  method: 'GET',
  params
})

// 药品订单-支付药款页面-根据处方信息计算药款
export const medicineOrder = (data) => request({
  url: '/patient/medicine/order',
  method: 'POST',
  data
})
